package com.nuoniu.sibanyun.service.erp.in.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nuoniu.sibanyun.entity.erp.in.VInventoryCheckDetail;
import com.nuoniu.sibanyun.mapper.erp.in.VInventoryCheckDetailMapper;
import com.nuoniu.sibanyun.service.erp.in.IVInventoryCheckDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 小啊刚
 * @since 2021-05-19
 */
@Service
public class VInventoryCheckDetailServiceImpl extends ServiceImpl<VInventoryCheckDetailMapper, VInventoryCheckDetail> implements IVInventoryCheckDetailService {

    @Override
    public List<VInventoryCheckDetail> orderList(Long orderId,boolean isLossOrGain) {
        QueryWrapper<VInventoryCheckDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id",orderId);
        if (isLossOrGain){
            queryWrapper.ne("loss_or_gain_quantity",0);
        }
        List<VInventoryCheckDetail> list = list(queryWrapper);
        return list;
    }
}
